/*
#include <stack>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <sstream>
using namespace std;
void numDecodingsChild(string s,int &result){
	if(s.length()<1){
		result++;
		return;
	}
	string subStr=s.substr(1,s.length()-1);
	numDecodingsChild(subStr,result);
	if(s.length()>1){
		int tmp=0;
		string str=s.substr(0,2);
		tmp+=10*(str[0]-'0');
		tmp+=str[1]-'0';
		if(tmp<=26){
			subStr=s.substr(2,s.length()-2);
			numDecodingsChild(subStr,result);
		}
	}
}
int numDecodings(string s) {
	int p1=0,p2=0;
	if(s.length()<1)
		return 0;
	else if(s.length()==1){
		return s[0]=='0'?0:1;
	}else if(s.length()==2){
		return (s[0]!='0'&&s[1]!='0'?1:0)+((s[0] != '0' && ((s[0]-'0') * 10 + (s[1]-'0')) <= 26) ? 1 : 0); 
	}
	p1=s[0]=='0'?0:1;
	p2=(s[0]!='0'&&s[1]!='0'?1:0)+((s[0] != '0' && ((s[0]-'0') * 10 + (s[1]-'0')) <= 26) ? 1 : 0); 
	for(int i=2;i<s.length();i++){
		int tmp=0,t2;
		if(s[i]!='0'){
			tmp+=p2;
		}
		if(s[i-1]!='0'&&((s[i-1]-'0') * 10 + (s[i]-'0')) <= 26)
			tmp+=p1;
		t2=p2;
		p2=tmp;
		p1=t2;
	}
	return p2;
}
int main(){
	int a[]={1,2,2};
	vector<int> nums1(a,a+sizeof(a)/sizeof(int));
	cout<<numDecodings("110");
	cout<<endl;
	system("pause");
}
*/